package com.uzai.common.enums;

/**
 *
 * 卡密产品类型(0无效数据；1000= 全部; 1001=返利；1002=发朋友圈；1003=群发单；1004=公众号；
 * 1005=小程序；1006=CMS；1007=APP ；1008=托 ; 1009=名片转发 ; 1010=悠聊 ;)
 * @Auther: xiaoyuexl
 * @Date: 2021/8/13 11:31
 * @Description:
 */
public enum CdkeysProductTypeEnum {
    INVALID(0,"无效数据"),
    ALL(1000, "全包"),
    FL(1001,"返利"),
    PYQ(1002,"发朋友圈"),
    FD(1003,"群发单"),
    //WX_PUB(1004,"公众号"),
    //MINI_PRO(1005,"小程序"),
    //CMS(1006,"CMS"),
    //APP(1007,"APP"),
    TUO(1008,"托"),
    BANTRANSFER(1009,"名片转发"),
    UZAICHAT(1010,"悠聊"),

    ;

    private Integer id;
    private String desc;

    CdkeysProductTypeEnum(Integer id, String desc) {
        this.id = id;
        this.desc = desc;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static CdkeysProductTypeEnum getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (CdkeysProductTypeEnum type: CdkeysProductTypeEnum.values()) {
            if (type.getId().intValue() == id) {
                return type;
            }
        }
        return null;
    }
}
